package cn.com.wdjedu.androidapp.wjeduandroid.support.lib.mvputils;


import rx.Subscriber;

/**
 * RX的订阅者
 */
public abstract class RxSubscribe<T> extends Subscriber<T> {

    @Override
    public void onNext(T t) {
        _onNext(t);
    }


    @Override
    public void onError(Throwable e) {
        e.printStackTrace();
       if (e instanceof ServerException) {
            _onError(e.getMessage() + "");
        } else {
            _onError("请求失败,请稍后再试....");
        }
    }

    @Override
    public void onCompleted() {

    }

    public abstract void _onNext(T t);

    public abstract void _onError(String message);

}
